package com.pda.common.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.pda.common.database.BillInfo;
import com.pda.common.database.CodeInfo;
import com.pda.common.database.DealerInfo;
import com.pda.common.database.ProductInfo;
import com.pda.common.database.StoreInfo;

import com.pda.common.dao.BillInfoDao;
import com.pda.common.dao.CodeInfoDao;
import com.pda.common.dao.DealerInfoDao;
import com.pda.common.dao.ProductInfoDao;
import com.pda.common.dao.StoreInfoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig billInfoDaoConfig;
    private final DaoConfig codeInfoDaoConfig;
    private final DaoConfig dealerInfoDaoConfig;
    private final DaoConfig productInfoDaoConfig;
    private final DaoConfig storeInfoDaoConfig;

    private final BillInfoDao billInfoDao;
    private final CodeInfoDao codeInfoDao;
    private final DealerInfoDao dealerInfoDao;
    private final ProductInfoDao productInfoDao;
    private final StoreInfoDao storeInfoDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        billInfoDaoConfig = daoConfigMap.get(BillInfoDao.class).clone();
        billInfoDaoConfig.initIdentityScope(type);

        codeInfoDaoConfig = daoConfigMap.get(CodeInfoDao.class).clone();
        codeInfoDaoConfig.initIdentityScope(type);

        dealerInfoDaoConfig = daoConfigMap.get(DealerInfoDao.class).clone();
        dealerInfoDaoConfig.initIdentityScope(type);

        productInfoDaoConfig = daoConfigMap.get(ProductInfoDao.class).clone();
        productInfoDaoConfig.initIdentityScope(type);

        storeInfoDaoConfig = daoConfigMap.get(StoreInfoDao.class).clone();
        storeInfoDaoConfig.initIdentityScope(type);

        billInfoDao = new BillInfoDao(billInfoDaoConfig, this);
        codeInfoDao = new CodeInfoDao(codeInfoDaoConfig, this);
        dealerInfoDao = new DealerInfoDao(dealerInfoDaoConfig, this);
        productInfoDao = new ProductInfoDao(productInfoDaoConfig, this);
        storeInfoDao = new StoreInfoDao(storeInfoDaoConfig, this);

        registerDao(BillInfo.class, billInfoDao);
        registerDao(CodeInfo.class, codeInfoDao);
        registerDao(DealerInfo.class, dealerInfoDao);
        registerDao(ProductInfo.class, productInfoDao);
        registerDao(StoreInfo.class, storeInfoDao);
    }
    
    public void clear() {
        billInfoDaoConfig.clearIdentityScope();
        codeInfoDaoConfig.clearIdentityScope();
        dealerInfoDaoConfig.clearIdentityScope();
        productInfoDaoConfig.clearIdentityScope();
        storeInfoDaoConfig.clearIdentityScope();
    }

    public BillInfoDao getBillInfoDao() {
        return billInfoDao;
    }

    public CodeInfoDao getCodeInfoDao() {
        return codeInfoDao;
    }

    public DealerInfoDao getDealerInfoDao() {
        return dealerInfoDao;
    }

    public ProductInfoDao getProductInfoDao() {
        return productInfoDao;
    }

    public StoreInfoDao getStoreInfoDao() {
        return storeInfoDao;
    }

}
